package main

import (
	"fmt"
)

func main() {
	a := squares()
	fmt.Println(a())
	fmt.Println(a())
	fmt.Println(a())
	fmt.Println(a())
}

func squares() func() int {
	var i int
	return func() int {
		i++
		return i * i
	}
}
